const express = require('express');

const router = express.Router();

router.get('/list', (req, res) => {
  console.log(req.query); // 获取查询参数
  res.send('user list...');
});

router.get('/:id', (req, res) => {
  console.log(req.params); // 获取动态参数
  res.send('user info...');
});
// express.json(), express.urlencoded()
router.post('/add', (req, res) => {
  console.log(req.body); // 获取请求体数据
  res.send('user add...');
});

module.exports = router;
